//
//  RBDaylySignSucPopVC.m
//  zhongzhenglu
//
//  Created by XL on 2022/8/30.
//

#import "RBDaylySignSucPopVC.h"
#import "UIView+RBAdd.h"
#import "UIScrollView+RBAdd.h"
#import <Masonry.h>
#import "RBThemeConfig.h"
#import <UIColor+YYAdd.h>
#import <UIView+YYAdd.h>
#import "RanTool.h"
#import "RBPager.h"

@interface RBDaylySignSucPopVC ()

@property(nonatomic, strong)IBOutlet UILabel *daysL;
@property(nonatomic, strong)IBOutlet UILabel *pointsL;

@end

@implementation RBDaylySignSucPopVC

#pragma mark - Lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self setup];
}

#pragma mark - Private

- (void)setup
{
    self.dismissOnTapBlank = NO;
    [self.contentView zoomSubViewsWithSelf];
    self.daysL.text = [NSString stringWithFormat:@"您已连续签到%zd天", self.day];

    self.pointsL.font = [UIFont systemFontOfSize:Zoom(52)];
    self.pointsL.textColor = [UIColor colorWithHexString:@"#FE7E0A"];
    self.pointsL.adjustsFontSizeToFitWidth = YES;
    
    if ([self.type isEqualToString:@"1"]) {
        self.pointsL.text = self.points;
    } else {
        NSString *pointsString = [NSString stringWithFormat:@"%@积分", self.points];
        
        self.pointsL.attributedText = [NSString changeSectionFontWithString:pointsString font:[UIFont systemFontOfSize:Zoom(16) weight:UIFontWeightMedium] from:pointsString.length - 2 lenth:2];
    }
    
//    self.pointsL.attributedText = [RanTool attributeStringMaker:^(NSMutableArray *maker) {
//        [maker addAttributeStringWithFont:[UIFont systemFontOfSize:Zoom(52)] color:[UIColor colorWithHexString:@"#FE7E0A"] string:self.points];
//        [maker addAttributeStringWithFont:[UIFont systemFontOfSize:Zoom(16) weight:UIFontWeightMedium] color:[UIColor colorWithHexString:@"#FE7E0A"] string:@"积分"];
//    }];
}

- (void)show
{
    [self.contentView addLittleZoomAnimation];
}

- (IBAction)dismiss
{
    [self dismissViewControllerAnimated:NO completion:nil];
}

#pragma mark - Network

#pragma mark - Event

#pragma mark - Setter

#pragma mark - Getter

@end
